import type { BrandRecord } from './Brand';

export interface InventoryHistoryRecord {
  id: number;
  brandId: number;
  customerId?: number;
  type: InventoryHistoryType;
  price: number;
  marketPrice?: number;
  nub: number;
  description: string;
  createTime: string;
  updateTime: string;
  brand: BrandRecord;
}

export enum InventoryHistoryType {
  Add = '1',
  Subtract = '-1',
}

export const InventoryHistoryTypeMap = {
  [InventoryHistoryType.Add]: {
    text: '入库',
    status: 'success',
  },
  [InventoryHistoryType.Subtract]: {
    text: '出库',
    status: 'error',
  },
};

export const ReverseType = {
  [InventoryHistoryType.Add]: InventoryHistoryType.Subtract,
  [InventoryHistoryType.Subtract]: InventoryHistoryType.Add,
};
